@echo off
rem if exist test.txt (echo test.txt exists!) else echo test.txt not exists!
rem if exist no.txt (echo no.txt exists!) else echo no.txt not exists!
rem get folder name
set FOLDER_COUNT=0

:check_folder_exists
set DATA_PATH=%date:~0,10%_%time:~0,2%_%time:~3,2%_%time:~6,5%
echo "Create folder %DATA_PATH% ..."
if not exist %DATA_PATH%  mkdir %DATA_PATH%

echo Export database web_user ...
..\bin\mysqldump -uroot web_user > %DATA_PATH%\web_user.sql --default-character-set=gbk
if exist %DATA_PATH%\web_user.sql ( echo Exported successfully! ) else  goto failed_end

echo Export database web_user_shards ...
..\bin\mysqldump -uroot web_user_shards > %DATA_PATH%\web_user_shards.sql --default-character-set=gbk
if exist %DATA_PATH%\web_user_shards.sql ( echo Exported successfully! ) else  goto failed_end

echo Export database 19floor ...
..\bin\mysqldump -uroot 19floor > %DATA_PATH%\19floor.sql --default-character-set=gbk
if exist %DATA_PATH%\19floor.sql ( echo Exported successfully! ) else  goto failed_end

echo Export database forum_fashion ...
..\bin\mysqldump -uroot forum_fashion > %DATA_PATH%\forum_fashion.sql --default-character-set=gbk
if exist %DATA_PATH%\forum_fashion.sql ( echo Exported successfully! ) else  goto failed_end

goto end


:failed_end
echo backup failed!
goto end

:end
@echo on